package petrus.components.display 
{
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.geom.Rectangle;
	/**
	 * ...
	 * @author Mariusz Cwilag
	 */
	public class DisplayHelper extends Object 
	{
		
		public function DisplayHelper() 
		{
			
		}
		
		/**
		 * 
		 * @param	rectangle
		 * @param	color
		 */
		public static function drawShape(rectangle:Rectangle=null, color:uint=0x000000, opacity:Number=1):Shape
		{
			var shape:Shape = new Shape();			
			shape.graphics.clear();
			shape.graphics.beginFill(color, opacity);
			shape.graphics.drawRect(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
			shape.graphics.endFill();
			return shape;
		}
		
		/**
		 * 
		 * @param	rectangle
		 * @param	color
		 */
		public static function drawSprite(rectangle:Rectangle=null, color:uint=0x000000, opacity:Number=1):Sprite
		{
			var sprite:Sprite = new Sprite();			
			sprite.graphics.clear();
			sprite.graphics.beginFill(color, opacity);
			sprite.graphics.drawRect(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
			sprite.graphics.endFill();
			return sprite;
		}
	}

}